package net.xdclass.controller;

import net.xdclass.domain.Video;
import net.xdclass.service.VideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author: yy.bao
 * @Date: 2021/3/16 18:17
 */
@RestController
@RequestMapping("api/v1/video")
public class VideoController {


    @Autowired
    private VideoService videoService;

    @RequestMapping("find_by_id")
    public Object findById(Integer videoId, HttpServletRequest request){
        Video video =videoService.findById(videoId);
        //方便大家发现请求是那台机器
        video.setServeInfo(request.getServerName()+":"+request.getServerPort());
        return  video;
    }

}
